package controller
{
	import flash.events.Event;
	import flash.text.TextField;
	
	import subumbo.micro.controller.ApplicationEvent;
	import subumbo.micro.controller.Component;

	public class HudViewController extends Component
	{
		public var score:TextField
		
		override protected function init(e:Event):void
		{
			super.init(e);
			addListener("update_score", updateScore);
			addListener("reset_score", reset);
		}
		
		private function updateScore(e:ApplicationEvent):void
		{
			score.text = e.data.toString();
		}
		
		private function reset(e:ApplicationEvent):void
		{
			trace("reset");
			score.text = "0";
		}
	}
}